package com.boolib.http.log.spi;

import com.boolib.http.core.abstracts.AbstractRequestHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author ziyao
 */
@Slf4j
@Component
public class LogRequestHandler extends AbstractRequestHandler {
    @Override
    public boolean isSupport() {
        return true;
    }


    @Override
    public void handler(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
        log.info("request url: {}, method: {},contentType: {}",httpServletRequest.getServletPath(),httpServletRequest.getMethod(),httpServletRequest.getContentType());
    }
}
